<?php
declare(strict_types=1);
namespace SixShop\Lakala\Enum;

enum WechatOrderStateEnum:int
{
    /**
     * 待发货
     */
    case PENDING_SHIPMENT = 1;

    /**
     * 已发货
     */
    case SHIPPED = 2;

    /**
     * 确认收货
     */
    case CONFIRM_RECEIPT = 3;

    /**
     * 交易完成
     */
    case TRADE_COMPLETED = 4;

    /**
     * 已退款
     */
    case REFUNDED = 5;

    /**
     * 资金待结算
     */
    case FUNDS_PENDING_SETTLEMENT = 6;

    public function toString(): string
    {
        return match ($this) {
            self::PENDING_SHIPMENT => '待发货',
            self::SHIPPED => '已发货',
            self::CONFIRM_RECEIPT => '确认收货',
            self::TRADE_COMPLETED => '交易完成',
            self::REFUNDED => '已退款',
            self::FUNDS_PENDING_SETTLEMENT => '资金待结算',
            default => '未知状态',
        };
    }
}